package fr.babos.test.components
{
	import com.greensock.TweenLite;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import fr.babos.graphic.components.base.BorderContainer;
	import fr.babos.graphic.components.base.ResizableComponent;
	import fr.babos.graphic.components.base.StageWrapper;
	import fr.babos.graphic.components.medias.NativeVideoContainer;
	
	/**
	 * ...
	 * @author Pascal Achard
	 */
	public class NativeVideoContainerTest extends Sprite
	{
		private var _nativeVideoContainer:NativeVideoContainer;
		private var _mainContainer:BorderContainer;
		private var _wrapper:StageWrapper;
		private var _container:ResizableComponent;
		
		public function NativeVideoContainerTest()
		{
			if (stage != null)
				init()
			else
				addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			// Créer le wrapper de l'application
			_wrapper = new StageWrapper(stage);
			
			_container = new ResizableComponent()
			_container.place(30, 30, 30, 30).into(_wrapper, "container");
			
			_nativeVideoContainer = new NativeVideoContainer();
			_nativeVideoContainer.place(0, 0, 0, 0).into(_container);
			//_nativeVideoContainer.setSize(_container.width, 180);
			
			_nativeVideoContainer.loadVideo("http://burst.zpks.com/burst/9134a786ca84bf37ec97c7015fd1872f/4f199419/61836.mp4", "http://zpks.com/v/3/1/31857/61657-4.jpg", false, true);
			
			// test
			
			//_nativeVideoContainer.upDateLayout();
			
			
			/*TweenLite.to(_container, 4, 
			{
				y:"30"
			});*/
		}
	
	}

}